package cn.jetpiece.cloud.joss.api.config.properties;

import lombok.Data;

/**
 * Joss客户端调用配置
 *
 * @author XuJZ
 */
@Data
public class JossClientProperties {

    /**
     * 配置前缀
     */
    public static final String PREFIX = "jetpiece.joss-client";

    /**
     * 默认上传Api路径
     */
    public static final String UPLOAD_API_PATH = "oss/upload";

    /**
     * 静态配置
     */
    private static JossClientProperties INSTANCE;

    /**
     * 是否启用
     **/
    private boolean enabled = false;

    /**
     * 上传Api路径
     */
    private String uploadApiPath = UPLOAD_API_PATH;

    /**
     * Joss地址前缀
     */
    private String baseUrlPrefix;

    /**
     * 默认桶名称
     * eg: {defaultBucketName}/{defaultPathPrefix}/{defaultFilePath}/{dateFormat}
     */
    private String defaultBucketName;

    /**
     * 默认路径前缀
     * eg: {defaultBucketName}/{defaultPathPrefix}/{defaultFilePath}/{dateFormat}
     */
    private String defaultPathPrefix;

    /**
     * 默认模块
     * eg: {defaultBucketName}/{defaultPathPrefix}/{defaultFilePath}/{dateFormat}
     */
    private String defaultFilePath;

    /**
     * 默认日期格式化
     * 年月
     * eg: {defaultBucketName}/{defaultPathPrefix}/{defaultFilePath}/{dateFormat}
     */
    private String dateFormat = "yyyy-MM";

    public static JossClientProperties getInstance() {
        return INSTANCE;
    }

    public void setInstance(JossClientProperties instance) {
        JossClientProperties.INSTANCE = instance;
    }

}
